import Vue from 'vue'
import Router from 'vue-router' // npm install --save vue-router


Vue.use(Router);

const routes = [
    {
        path: '/',
        redirect: '/play',//重定向到index这个路径
        hidden: true
    },
    {path: '/highchart', component: () => import('./views/highchart'), name: '折线图'},
    {path: '/exportExcel', component: () => import('./views/exportExcel'), name: '导出表格'},
    {path: '/scoll', component: () => import('./views/scoll'), name: '滑动'},
    {path: '/scoll2', component: () => import('./views/scoll2'), name: '滑动'},
    {path: '/inputFocus', component: () => import('./views/inputFocus'), name: '聚焦失焦'},
    {path: '/prov', component: () => import('./views/prov'), name: '省市联动'},
    {path: '/prov2', component: () => import('./views/prov2'), name: '省市联动'},
    {path: '/upLoadFile', component: () => import('./views/upLoadFile'), name: '文件上传'},
    {path: '/upLoadFile2', component: () => import('./views/upLoadFile2'), name: '文件上传'},
    {path: '/upLoadFile3', component: () => import('./views/upLoadFile3'), name: '文件上传'},
    {path: '/upLoadFile4', component: () => import('./views/upLoadFile4'), name: '文件上传'},
    {path: '/play', component: () => import('./views/play'), name: '文件上传'},
];

let router = new Router({
    mode: 'history',
    routes
});

router.beforeEach(async (to, from, next) => {
    window.document.title = to.name;
    next();
});

export default router
